package spring.cloud.demo;

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cglib.transform.impl.AccessFieldTransformer;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

import spring.cloud.demo.filter.AccessFilter;

/**
 * @SpringCloudApplication注解，之前没有提过，通过源码我们看到，它整合了@SpringBootApplication、@EnableDiscoveryClient、@EnableCircuitBreaker，
 * 主要目的还是简化配置
 */
@SpringCloudApplication
@EnableZuulProxy
public class GatewayApplication {
	
	@Bean
	public AccessFilter accessFilter(){
		return new AccessFilter();
	}
	
	public static void main(String[] args) {
		new SpringApplicationBuilder(GatewayApplication.class).web(true).run(args);
	}
}
